@use "./dark.scss";
@use "./small.scss";

/* 修复 Chrome 浏览器输入框内选中字符行高异常的bug */
.el-input .el-input__inner {
	line-height: calc(var(--el-input-height, 40px) - 4px);
}

.el-input-number {
	width: 100%;
	.el-input__inner {
		text-align: left !important;
	}
}

.el-divider__text {
	&.is-center {
		transform: translateX(-50%) translateY(-62%);
	}
}

.el-menu {
	-webkit-user-select: none;
	user-select: none;
	.el-sub-menu__title:hover {
		background-color: var(--el-color-primary-light-9) !important;
	}
}

.el-table {
	--el-table-border-color: var(--el-border-color);
}

.el-card {
	box-sizing: border-box;
	padding: 10px;
	overflow-x: hidden;
	.el-card__header {
		border-bottom: 1px solid var(--el-border-color-extra-light);
	}
}

.el-tabs {
	height: inherit;
	&.el-tabs--top {
		.el-tabs__content {
			flex: 1;
			display: flex;
			flex-direction: column;
		}
	}
	.el-tabs__content {
		padding: 10px;
		height: 100%;
		.el-tab-pane {
			flex: 1;
			height: 100%;
			display: flex;
			flex-direction: column;
			> :first-child {
				height: 100%;
			}
		}
	}
}

.el-textarea__inner {
	padding: 5px 11px;
}

.el-form {
	.el-form-item--small {
		margin-bottom: 14px;
	}
	.el-form-item {
		// 分割线
		&:has(.el-form-item__content > .el-divider--horizontal) {
			margin-bottom: 0;
		}
	}
	&:not(.g-form-detail) {
		.el-form-item {
			// 表单组件宽度100%
			.el-form-item__content {
				> * {
					width: 100%;
				}
			}
		}
	}
}

/* 消息提示框换行 */
.el-message {
	white-space: pre-wrap !important;
}
.el-notification {
	white-space: pre-wrap !important;
}

.el-divider--horizontal {
	margin: 8px 0 18px !important;
}
.el-divider--vertical {
	margin: 0 4px !important;
}

.el-select-dropdown {
	.el-select-dropdown__item {
		padding: 0 20px;
	}
}
.el-tree-select__popper {
	.el-select-dropdown__item {
		padding: 0 20px 0 0;
	}
}

.el-dropdown {
	line-height: normal;
}

.el-checkbox.is-bordered.is-disabled.is-checked {
	border-color: var(--el-color-primary);
}

.el-form {
	/* 解决不能包含 el-form-item 的margin的高度 */
	overflow: hidden;
}
